<?php
require_once "../Common/database.php";
require_once "../Common/values.php";
require_once "theme.php";
if($publiclock=='true')
{
echo '<center><H1>SYSTEM lOCKED!! '.$lockedreason.'</CENTER></H1>';
exit;
}
echo '<body bgcolor="#6495ED">';
$log=$_GET[l];

$result = mysql_query("SELECT * FROM tblJobs where LogNumber='$log' AND Private!='checked'");
if(mysql_affected_rows()>0)
{

echo '<h3>Update Job</h3>';
$row = mysql_fetch_array($result);

echo '<form method="Post" Action='.$log.'>';
echo '<table Border=1 width=100%><tr>';
echo '<td>Log : '.'<INPUT type="hidden" name="log" value = $log >';echo $log.'</td>';
echo '<td>Operator :<p> '; echo $row['Operator'].'</td>' ;
echo '<td>Date : '; echo $row['Date'].'</td>';
echo '<td> Time : '; echo $row['Time'].'</td>';

echo '<tr><td>Requestor : '.$row['Requestor'].'</td>';
echo '<td>Assigned to: <p>'.$row[Assigned];
echo'</td></tr>';
echo '<tr><td> Branch No : <p> '.$row['Branch'].'</td>  <td>Department:<p>'.$row['Department'].'</td>  <td> Phone: <p>'.$row['Phone'].'</td><td>  VNC :<p> IT ONLY !</td></tr>';
echo '<tr><td><p> Due date : <p>'.$row['Due'].'</td>';
echo ' <td>Proirty:<p>'.$row['Proirty'].'</td>';
echo '<td>Status :<p> '.$row['Status'].'</td>' ;
echo '<td> Closed: <INPUT type="checkbox" name="closed" value="checked"'.$row['Closed'].'" ></td>';
#echo '<td> Closed: <INPUT type="checkbox" name="closed" checked></td>';
echo '</TR>';
echo '<tr><td colspan=4>Subject: '.$row['Subject'].'</td></tr>';
echo '<tr><td colspan=4>Problem : <br><br> '.nl2br($row['Problem']).'</td></tr>';
echo '<tr><td colspan=4>Solution :<p>';
#echo '<textarea rows=5 Disabled cols=100 name=solution></textarea></td></tr>';

$result = mysql_query("SELECT * FROM tblSolutions where LogNumber='$log' ORDER BY `key` DESC");

echo '<table border=1 Width=100%><tr><td>Date</td><td>Time</td><td>Operator</td><td>Solution</td><td>Time spent</td>';
while($row = mysql_fetch_array($result))
{
echo '<tr><td>'.$row['Date'].'</td><td>'.$row['Time'].'</td><td>'.$row['Operator'].'</td><td>'.nl2br($row['Solution']).'</td><td>'.$row['TimeS'].'</tr>';
$total=$row[TimeS]+$total;

}
echo'</table>';
echo '<b>Total Time : </b>'.$total.' Mins';
}
else
{
echo '<h3>Private job please contact IT for details</h3>';
}
echo '<br><a href="dashboard.php">Back</a>';
mysql_close();
?>